import { Controller, Post as PostMethod, UseGuards, Body, Req } from '@nestjs/common';
import { ApiOperation } from '@nestjs/swagger';
import { CommentService } from './comment.service';
import { CreateCommentDto } from './dto/create-comment.dto';


@Controller('comment')
export class CommentController {
  constructor(private svc: CommentService) {}

  @ApiOperation({ summary: '发表评论或回复' })
  @PostMethod()
  create(@Req() req, @Body() dto: CreateCommentDto) {
    return this.svc.create(dto, req.user.id);
  }
}
